import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import(/* webpackChunkName: "cart" */ '../views/index/index.vue')
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import(/* webpackChunkName: "cart" */ '../views/cart/cart.vue')
  }, {
    path: '/register',
    name: 'register',
    component: () => import(/* webpackChunkName: "register" */ '../views/register/register.vue')
  }, {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/login.vue')
  }, {
    path: '/index',
    name: 'index',
    component: () => import(/* webpackChunkName: "index" */ '../views/index/index.vue')
  }, {
    path: '/detail/:id',
    name: 'detail',
    component: () => import(/* webpackChunkName: "detail" */ '../views/detail/detail.vue')
  }, {
    path: '/searchres/:id',
    name: 'searchres',
    component: () => import(/* webpackChunkName: "searchres" */ '../views/searchres/searchres.vue'),
    props: true
  }, {
    path: '/search',
    name: 'search',
    component: () => import(/* webpackChunkName: "search" */ '../views/search/search.vue'),
  }, {
    path: '/order',
    name: 'order',
    component: () => import(/* webpackChunkName: "order" */ '../views/order/order.vue'),
  }, {
    path: '/orderDetail/:id',
    name: 'orderDetail',
    component: () => import(/* webpackChunkName: "orderDetail" */ '../views/orderdetail/orderdetail.vue'),
    props: true
  }, {
    path: '/kind',
    name: 'kind',
    component: () => import(/* webpackChunkName: "kind" */ '../views/kind/kind.vue'),
    props: true
  }, {
    path: '/my',
    name: 'my',
    component: () => import(/* webpackChunkName: "my" */ '../views/my/my.vue'),
  }, {
    path: '/setUserMsg',
    name: 'setUserMsg',
    component: () => import(/* webpackChunkName: "setUserMsg" */ '../views/setuser/setUserMsg.vue'),
  }, {
    path: '/brand',
    name: 'brand',
    component: () => import(/* webpackChunkName: "band" */ '../views/brandList/brand.vue'),
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
